<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<%template _header%>
<%namespace YouHP.Model%>
<%namespace YouHP.Model.Group%>
<%namespace YouHP.Utility%>
<%namespace YouHP.BLL%>
<link type="text/css" rel="stylesheet" href="/support/Alpha/css/biaoqian.css" />
<link rel="stylesheet" href="/support/common/jquery-ui.css" type="text/css" />
<script type="text/javascript" src="/support/common/jquery.js"></script>
<script type="text/javascript" src="/support/common/ui.core.js"></script>
<script type="text/javascript" src="/support/common/ui.draggable.js"></script> 
<script type="text/javascript" src="/support/common/ui.resizable.js"></script> 
<script type="text/javascript" src="/support/common/ui.dialog.js"></script>

<script type="text/javascript">
		var curtab = "user";
	    var succ =true;
		function swapTab(tab, type)
		{

			 var ctrl = _$("ui-" + curtab);
			 ctrl.style.display = 'none';
			 ctrl = _$("ui-" + tab);
			 ctrl.style.display = 'block';
			 curtab = tab;
			 _$("searchtype").value = type ;
			
		}
		
        function Search()
        {
            var str ="";
           
            switch(parseInt(_$("searchtype").value))
            {
                case 1:
                    str="province="+_$("province").options[_$("province").selectedIndex].value;
                    str += ("&city="+_$("city").options[_$("city").selectedIndex].value) ;
                    break;
                case 2:
                    var begin = parseInt(_$("beginyear").options[_$("beginyear").selectedIndex].value) ;
                    var end = parseInt(_$("endyear").options[_$("endyear").selectedIndex].value) ;
                    str="agefrom="+ (begin<end ? begin : end );
                    str += ("&ageto="+(begin<end ? end : begin)) 
                    break ; 
                case 3:
                    str="name="+_$("username").value.escUrl();
                    break;
                case 4: 
                    str="dszid="+_$("dszid").options[_$("dszid").selectedIndex].value;                               
                    break;
                case 5:
                    str="trmname="+_$("treatmentname").value.escUrl();          
                    break ;
                case 6:                     
                    str="symid="+_$("symptomname").options[_$("symptomname").selectedIndex].value; 
                    break ;
            }
            location.href = "/Pages/Alpha/PatientList.aspx?"+str;
        }
                  
                
	   
    </script>

<div class="layout-cols2">
	<div class="col1">
		
 <%csharp%>TempUrl = ModuleCtrl.Header4("PatientSearch","搜索病友",false,false); <%/csharp%>
{TempUrl}
<div  style="padding:5px 10px;">
        <div id="search-links" class="searchbox">
	                <img src="/support/Alpha/images/icon_search_results.gif" />
			        <label>搜索条件：</label>
                    <a href="#" id="lnk-location" name="location" onclick="swapTab('location',1);">地区|</a>
                    <a href="#" id="lnk-age" name="age" onclick="swapTab('age',2);">年龄|</a> <a href="#"
                        id="lnk-age" name="user" onclick="swapTab('user',3);">用户名|</a> <a href="#" id="lnk-age"
                            name="disease" onclick="swapTab('disease',4);">疾病|</a> <a href="#" id="lnk-age" name="treatment"
                                onclick="swapTab('treament',5);">治疗|</a> <a href="#" id="lnk-age" name="symptom" onclick="swapTab('symptom',6);">
                                    症状</a>
         </div>

    <div id="search-ui">
        <%csharp%>TempUrl="/PatientList.aspx";<%/csharp%>
        <input type=hidden id="searchtype" value="3" />
        <table>
            <tr>
            <td width="10px"></td>
                <td width="400" valign="middle">
                    <div id="ui-location" style="display: none; float:left;">
                     地区: 
                    省份
                    <select name="province" id="province"  onchange="if(this.value !='') setCity(this.options[this.selectedIndex].value)">
                 
                    <option value="">-不限-</option>  

                    <%csharp%>
                    foreach(DistrictInfo Info in ProvinceList)
                    {
                    <%/csharp%>
                    <option value="{Info.Id}">{Info.Name}</option>     
                    <%csharp%>
                    }
                    <%/csharp%>
                    </select>
                    城市
                    <select name="city" id ="city">
                    <option value ="">-不限-</option>
                    </select>
                    </div>
                    <div id="ui-age" style="display: none;float:left;">
                        年龄范围： 
                        <select id="beginyear" name="age1">
                            <option value="-1" selected>不限</option>
                            <option value="10">10</option>
                            <option value="20">20</option>
                            <option value="30">30</option>
                            <option value="40">40</option>
                            <option value="50">50</option>
                            <option value="60">60</option>
                            <option value="70">70</option>
                        </select>岁 到
                        <select id="endyear" name="age2">
                            <option value="-1" selected>不限</option>
                           <option value="10">10</option>
                            <option value="20">20</option>
                            <option value="30">30</option>
                            <option value="40">40</option>
                            <option value="50">50</option>
                            <option value="60">60</option>
                            <option value="70">70</option>
                        </select>岁

                    </div>
                    <div id="ui-user" style="display: block;float:left;">
                        用户名：
                        <input type="text" id="username" name="name" length="20">
                    </div>
                    <div id="ui-disease" style="display: none;float:left;">
                        疾病:
                        <select id="dszid" name="dszid">
                            <option value="" selected>不限</option>
                            <%csharp%>
                            foreach( DiseaseInfo Info in DiseaseLst) {
                            <%/csharp%>
                            <option value="{Info.Id}">{Info.Name}</option>
                            <%csharp%>
                            }
                            <%/csharp%>
                        </select>
                    </div>
                    <div id="ui-treament" style="display: none;float:left;">
                        治疗：
                        <input type="text" id="treatmentname" name="trmname" />
                    </div>
                    <div id="ui-symptom" style="display: none;float:left;">
                        症状：
                        <select id="symptomname" name="symname">
                            <option value="" selected>不限</option>
                            <%csharp%>
                            foreach( SymptomInfo Info in SymptomLst) {
                            <%/csharp%>
                            <option value="{Info.Id}">{Info.Name}</option>
                            <%csharp%>
                            }
                            <%/csharp%>
                        </select>
                    </div> 
                           &nbsp;&nbsp; <input id="post" type="button" value="寻找病友" onclick="Search()" class="button"/>
                </td>
                    
                 <%csharp%>TempUrl="/SearchPatient.aspx?advance=1";<%/csharp%>
                <td align="center"><a href={this.GetUrl(TempUrl)} class="yellowbutton">>>高级搜索</a></td>
            </tr>
        </table> 
    </div>  
 </div>
 <%csharp%>TempUrl = ModuleCtrl.Footer("PatientSearch"); <%/csharp%>
 {TempUrl}
 
<!-- 推荐用户开始-->
 <%csharp%>TempUrl = ModuleCtrl.Header4("RecommendedUser","推荐用户",false,false); <%/csharp%>
 {TempUrl}
 
 <%csharp%> if(RecommendedUserList.Count == 0){ <%/csharp%>
                <div class="content">
				<p><b>没有推荐用户!!</b></p>
				</div>
				<%csharp%> } else { <%/csharp%>
				
				<table  border="0" cellpadding="0" cellspacing="0" class="plist">
	               <tr align="center" style="height:30px;"> 
            <td width="10%" height="26" align="center"><b class="tdtitle">头像</b></td>

            <td width="20%"><b class="tdtitle">疾病</b></td>
            <td width="20%"><b class="tdtitle">性别/年龄/地区</b></td>
           
            <td width="35%"><b class="tdtitle"> 个人简介</b></td>
            <%csharp%>if(UserData.Id > 0) { <%/csharp%>
            <td><b class="tdtitle">&nbsp;</b></td>
            <%csharp%> } <%/csharp%>
            </tr>
				<%csharp%>
				string str="tr_bgcolor_0";
				foreach(UserInfo item in RecommendedUserList) { 
				
				<%/csharp%>
					<tbody><tr height="60" class="{str}">
					<%csharp%>TempUrl = "/Profile/Index.aspx?uid=" + item.Id; <%/csharp%>
						<td  align="center" style="padding:5px;">
						    <a href="{this.GetUrl(TempUrl)}" class="user_img"><img src="{item.Avatar}" height="48" width="48"></img><br />
						    {item.UserName}</a><br /><%if item.IsOnline==1%><font style="font-size:12px; font-weight:bold;">(当前在线)</font><%else%><font style="font-size:12px; color:#808080;">(当前离线)</font><%/if%></td>
						
						<td  align="center">
						    <%csharp%> if (item.DiseaseId <= 0 || item.DiseaseName == "") { <%/csharp%>
						        <div class="content">
				                    <p><b>未指定疾病</b></p>
				                </div>
				            <%csharp%> } else  { TempUrl = "/Disease.aspx?id=" + item.DiseaseId; <%/csharp%>
							<a href="{this.GetUrl(TempUrl)}">{item.DiseaseName}</a>
							<p><font color="#808080">
							(<%csharp%>if(item.EnduringYear >= 1) { <%/csharp%> {item.EnduringYear}年 <%csharp%> } else { <%/csharp%>不到一年
							<%csharp%> } <%/csharp%>)</font></p>
							<%csharp%> } <%/csharp%>
						</td>
						<td  valign="middle" style="padding:15px;">
						  {item.Gender}/<%if item.Age>0&&item.Age<208%>{item.Age}<%else%>未知<%/if%>/

						    <%if item.Province!=""||item.City!=""%>{item.Province}&nbsp;{item.City}<%else%>未知<%/if%>
						  </td>  
						
						<%csharp%>
						string sb=item.Description; 
						if(sb.Length==0){sb="暂无个人简介";}
						if(sb.Length>50){
						sb=sb.Substring(0,Math.Min(50,sb.Length))+"……";}
						<%/csharp%>
						
						<td valign="middle">{sb}</td>
						
						<%csharp%>if(UserData.Id > 0) { <%/csharp%>
						<td  align="left" class="operatebutton">

						    <p><a href="javascript:if({UserData.Id}<=0) alert('请先登录！');else showMsgSendingDialog({item.Id});" class="sendpm">发送消息</a></p>
						    
						    <%csharp%>TempUrl = "/User/FriendAdd.aspx?uid=" + item.Id; <%/csharp%>
							<!--<p><a href="{this.GetUrl(TempUrl)}" class="addfriend">加为好友</a></p>-->
							<p><a href="javascript:showFriendRequestDialog('{item.Id}','{item.UserName}','{item.Avatar}');" class="addfriend">加为好友</a></p>
						</td>
						<%csharp%> } <%/csharp%>

					</tr></tbody>
					<%csharp%>
					if(str=="tr_bgcolor_0") str="tr_bgcolor_1";
					else str="tr_bgcolor_0";
					
					
					}<%/csharp%>
				</table>	
				
			<%csharp%> } <%/csharp%> <!-- end of if-else -->

				
  <%csharp%>TempUrl = ModuleCtrl.Footer("RecommendedUser"); <%/csharp%>
  {TempUrl}
 <!-- 推荐用户结束-->
 
 <%csharp%>TempUrl = ModuleCtrl.Header4("PatientList","病友列表",false,false); <%/csharp%>
{TempUrl}
			<%csharp%> if(PatientDataList.Count == 0){ <%/csharp%>
               <div class="content">
				<p><b>找不到相应的病友!!</b></p>
				</div>
				<%csharp%> } else { <%/csharp%>
	<table  border="0" cellpadding="0" cellspacing="0" class="plist">
	      <tr align="center" style="height:30px;"> 
            <td width="10%" height="26" align="center"><b class="tdtitle">头像</b></td>

            <td width="20%"><b class="tdtitle">疾病</b></td>
            <td width="20%"><b class="tdtitle">性别/年龄/地区</b></td>
           
            <td width="35%"><b class="tdtitle"> 个人简介</b></td>
            <%csharp%>if(UserData.Id > 0) { <%/csharp%>
            <td><b class="tdtitle">&nbsp;</b></td>
            <%csharp%> } <%/csharp%>
            </tr>
				<%csharp%>
				string str="tr_bgcolor_0";
				foreach(UserInfo item in PatientDataList) { 
				
				<%/csharp%>
					<tbody><tr height="60" class="{str}">
					<%csharp%>TempUrl = "/Profile/Index.aspx?uid=" + item.Id; <%/csharp%>
						<td  align="center" style="padding:5px;">
						    <a href="{this.GetUrl(TempUrl)}" class="user_img"><img src="{item.Avatar}" height="48" width="48"></img><br />
						    {item.UserName}</a><br /><%if item.IsOnline==1%><font style="font-size:12px; font-weight:bold;">(当前在线)</font><%else%><font style="font-size:12px; color:#808080;">(当前离线)</font><%/if%></td>
						
						<td  align="center">
						    <%csharp%> if (item.DiseaseId <= 0 || item.DiseaseName == "") { <%/csharp%>
						        <div class="content">
				                    <p><b>未指定疾病</b></p>
				                </div>
				            <%csharp%> } else  { TempUrl = "/Disease.aspx?id=" + item.DiseaseId; <%/csharp%>
							<a href="{this.GetUrl(TempUrl)}">{item.DiseaseName}</a>
							<p><font color="#808080">
							(<%csharp%>if(item.EnduringYear >= 1) { <%/csharp%> {item.EnduringYear}年 <%csharp%> } else { <%/csharp%>不到一年
							<%csharp%> } <%/csharp%>)</font></p>
							<%csharp%> } <%/csharp%>
						</td>
						<td  valign="middle" style="padding:15px;">
						  {item.Gender}/<%if item.Age>0&&item.Age<208%>{item.Age}<%else%>未知<%/if%>/

						    <%if item.Province!=""||item.City!=""%>{item.Province}&nbsp;{item.City}<%else%>未知<%/if%>
						  </td>  
						
						<%csharp%>
						string sb=item.Description; 
						if(sb.Length==0){sb="暂无个人简介";}
						if(sb.Length>50){
						sb=sb.Substring(0,Math.Min(50,sb.Length))+"……";}
						<%/csharp%>
						
						<td valign="middle">{sb}</td>
						
						<%csharp%>if(UserData.Id > 0) { <%/csharp%>
						<td  align="left" class="operatebutton">

						    <p><a href="javascript:if({UserData.Id}<=0) alert('请先登录！');else showMsgSendingDialog({item.Id});" class="sendpm">发送消息</a></p>
						    
						    <%csharp%>TempUrl = "/User/FriendAdd.aspx?uid=" + item.Id; <%/csharp%>
							<!--<p><a href="{this.GetUrl(TempUrl)}" class="addfriend">加为好友</a></p>-->
							<p><a href="javascript:showFriendRequestDialog('{item.Id}','{item.UserName}','{item.Avatar}');" class="addfriend">加为好友</a></p>
						</td>
						<%csharp%> } <%/csharp%>

					</tr></tbody>
					<%csharp%>
					if(str=="tr_bgcolor_0") str="tr_bgcolor_1";
					else str="tr_bgcolor_0";
					
					
					}<%/csharp%>
				</table>				
				<%csharp%> } <%/csharp%>
 <%csharp%>TempUrl = ModuleCtrl.Footer("PatientList"); <%/csharp%>
 {TempUrl}
	
		<div class="box">
			<div class="content">
				<div class="pages">
					{PatientPagingString}
				</div>
			</div>
		</div>
		
	</div>
<!--	<div id="BOX_overlay" style="background: #000; position: absolute; z-index:100; filter:alpha(opacity=50);-moz-opacity: 0.6;opacity: 0.6;"></div>-->
	<div id="DIALOG"><iframe FRAMEBORDER=0 SCROLLING=NO ></iframe></div>
<script type="text/javascript" src="/support/Alpha/Js/float.js"></script>
	
	
	<div class="col2">
		<%template _LatestAndActivePatientsLikeMe%>
		<%template _LogHottest%>
	</div>
	
</div>

<%template _footer%>		
